package org.raymond.iworks.study.basic.designpattern.factory.method.pizzastore.order;

import org.raymond.iworks.study.basic.designpattern.factory.method.pizzastore.pizza.Pizza;
import org.raymond.iworks.study.basic.designpattern.factory.method.pizzastore.pizza.BJCheesePizza;
import org.raymond.iworks.study.basic.designpattern.factory.method.pizzastore.pizza.BJPepperPizza;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
public class BJOrderPizza extends OrderPizza{
    @Override
    public Pizza createPizza(String orderType) {
        Pizza pizza = null;
        System.out.println("使用工厂方法模式");
        if("cheese".equals(orderType)){
            pizza = new BJCheesePizza();
        }else if("pepper".equals(orderType)){
            pizza = new BJPepperPizza();
        }
        return pizza;
    }
}
